# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=cantor
pkgver=24.02.2
pkgrel=0
# armhf blocked by extra-cmake-modules
# ppc64le, s390x and riscv64 blocked by qt5-qtwebengine
arch="all !armhf !s390x !riscv64 !ppc64le"
url="https://edu.kde.org/cantor/"
pkgdesc="KDE Frontend to Mathematical Software "
license="GPL-2.0-or-later"
makedepends="
	analitza-dev
	extra-cmake-modules
	karchive5-dev
	kcompletion5-dev
	kconfig5-dev
	kcoreaddons5-dev
	kcrash5-dev
	kdoctools5-dev
	ki18n5-dev
	kiconthemes5-dev
	kio5-dev
	knewstuff5-dev
	kparts5-dev
	kpty5-dev
	ktexteditor5-dev
	ktextwidgets5-dev
	kxmlgui5-dev
	poppler-qt5-dev
	python3-dev
	qt5-qtbase-dev
	qt5-qtsvg-dev
	qt5-qtwebengine-dev
	qt5-qtxmlpatterns-dev
	samurai
	syntax-highlighting-dev
	"
checkdepends="xvfb-run"
subpackages="$pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/education/cantor.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/cantor-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
98647569ef979a88941e5cd3e77653b36209b2c20333a9af4f369d4bf9d702d53bbe458bc6a935b99b8ed51e90437523ec9c9373ef180a06b34202806b31598b  cantor-24.02.2.tar.xz
"
